From f215f82679bd0198527878fe938e12e95809346a Mon Sep 17 00:00:00 2001 From: Kevin Cozens Date: Mon, 1 Jan 2007 20:58:45 +0000 Subject: [PATCH] Some changes to fix build problems in FreeBSD and Windows. 2007-01-01 Kevin Cozens Some changes to fix build problems in FreeBSD and Windows. * configure.ac: Added missing m4 defines specifying version numbers, and tests for libdl and libm (sets DL_LIB and MATH_LIB respectively). * babl.pc.in: Replaced several hard-coded items with ones defined when configure is run. * babl/base/Makefile.am: * extensions/Makefile.am: * tests/Makefile.am: Use $(DL_LIB) and $(MATH_LIB) instead of hard-coded options. svn path=/trunk/; revision=188 --- ChangeLog | 15 +++++++++++++++ babl.pc.in | 6 +++--- babl/base/Makefile.am | 2 +- configure.ac | 12 +++++++++++- extensions/Makefile.am | 2 +- tests/Makefile.am | 7 +------ 6 files changed, 32 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 91cce8d..2fa8e83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2007-01-01 Kevin Cozens + + Some changes to fix build problems in FreeBSD and Windows. + + * configure.ac: Added missing m4 defines specifying version numbers, + and tests for libdl and libm (sets DL_LIB and MATH_LIB respectively). + + * babl.pc.in: Replaced several hard-coded items with ones defined + when configure is run. + + * babl/base/Makefile.am: + * extensions/Makefile.am: + * tests/Makefile.am: Use $(DL_LIB) and $(MATH_LIB) instead of + hard-coded options. + 2006-12-29 Øyvind Kolås * configure.ac: set the version of babl to 0.0.9 diff --git a/babl.pc.in b/babl.pc.in index aa11ea8..f4dc741 100644 --- a/babl.pc.in +++ b/babl.pc.in @@ -4,8 +4,8 @@ libdir=@libdir@ includedir=@includedir@ Name: babl -Description: Dynamic; any to any, pixel format conversion library -Version: @VERSION@ -Libs: -L${libdir} -lbabl -ldl -lm +Description: Dynamic, any to any, pixel format conversion library +Version: @BABL_REAL_VERSION@ +Libs: -L${libdir} -lbabl-@BABL_API_VERSION@ @DL_LIB@ @MATH_LIB@ Cflags: -I${includedir}/@PACKAGE_NAME@-@BABL_API_VERSION@ diff --git a/babl/base/Makefile.am b/babl/base/Makefile.am index adbb139..2019ab6 100644 --- a/babl/base/Makefile.am +++ b/babl/base/Makefile.am @@ -23,4 +23,4 @@ EXTRA_DIST := \ rgb-constants.h \ util.h -LDADD = -lm +LDADD = $(MATH_LIB) diff --git a/configure.ac b/configure.ac index ca4dd49..669811e 100644 --- a/configure.ac +++ b/configure.ac @@ -3,6 +3,9 @@ AC_PREREQ(2.54) m4_define([babl_major_version], 0) m4_define([babl_minor_version], 0) m4_define([babl_micro_version], 9) +m4_define([babl_real_version], + [babl_major_version.babl_minor_version.babl_micro_version]) +m4_define([babl_version], [babl_real_version]) AC_INIT(babl, babl_major_version.babl_minor_version.babl_micro_version) AC_CONFIG_SRCDIR(babl/babl.h) @@ -12,6 +15,7 @@ BABL_MINOR_VERSION=babl_minor_version BABL_MICRO_VERSION=babl_micro_version BABL_REAL_VERSION=babl_real_version BABL_VERSION=babl_version +AC_SUBST(BABL_REAL_VERSION) BABL_API_VERSION=babl_major_version.babl_minor_version AC_SUBST(BABL_API_VERSION) @@ -53,7 +57,7 @@ if eval "test x$GCC = xyes"; then esac fi -babl_extension_dir="$(libdir)/babl" +babl_extension_dir="$libdir/babl" AC_SUBST(babl_extension_dir) AC_PATH_PROG(INKSCAPE, inkscape, no) @@ -115,11 +119,13 @@ esac AC_MSG_RESULT([$platform_win32]) AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes") +MATH_LIB=-lm AC_MSG_CHECKING([for native Win32]) case "$target_or_host" in *-*-mingw*) os_win32=yes PATHSEP=';' + MATH_LIB= ;; *) os_win32=no @@ -128,12 +134,16 @@ case "$target_or_host" in esac AC_MSG_RESULT([$os_win32]) AC_SUBST(PATHSEP) +AC_SUBST(MATH_LIB) AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes") AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes") dnl =========================================================================== +AC_CHECK_LIB([dl], [dlopen], [DL_LIB="-ldl"]) +AC_SUBST(DL_LIB) + AC_DEFINE_UNQUOTED(BABL_PATH, "~/.babl-$BABL_API_VERSION:/usr/local/lib/babl-$BABL_API_VERSION:/usr/lib/babl-$BABL_API_VERSION", [search path for babl extensions (default value of enviroment variable)]) AC_DEFINE(BABL_PATH_SEPERATOR, "/", [string used to seperate directories in a path string]) AC_DEFINE(BABL_LIST_SEPERATOR, ':', [seperator between paths in BABL_PATH]) diff --git a/extensions/Makefile.am b/extensions/Makefile.am index e6a0fcb..aff9ec0 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -30,7 +30,7 @@ LDADD = $(win32_libs) $(no-undefined) # $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< [own compile and link flags] CIE-Lab.so: CIE-Lab.c - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDADD) -lm + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDADD) $(MATH_LIB) #lcms.so: lcms.c # $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDADD) `pkg-config lcms --cflags --libs` ############################################################################# diff --git a/tests/Makefile.am b/tests/Makefile.am index 7302794..946047b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,8 +1,3 @@ -if OS_WIN32 -else -dl = -ldl -endif - TESTS = \ grayscale_to_rgb \ rgb_to_bgr \ @@ -30,7 +25,7 @@ models_SOURCES = models.c AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/babl -LDADD = $(top_builddir)/babl/libbabl.la -lm ${dl} +LDADD = $(top_builddir)/babl/libbabl.la $(DL_LIB) $(MATH_LIB) noinst_PROGRAMS = \ introspect \ -- 2.30.2